package cn.tansanqinger.controller.topic;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.fasterxml.jackson.databind.ObjectMapper;

import cn.tansanqinger.dao.sql.group.ReportUserAndGroupSqlDaoImpl;
import cn.tansanqinger.service.topic.ITopicService;

@Controller
@RequestMapping("/admin/topic")
public class TopicCommentReportController {
	
	@Autowired
	private ITopicService service;

	@RequestMapping("/list6")
	public ModelAndView list(HttpServletRequest request, ModelAndView mv) {
		mv.setViewName("topic/list6");
		return mv;
	}
	
	@RequestMapping("/findListData6")
	@ResponseBody
	public String findListData(HttpServletRequest request) {
		try {
			return new ObjectMapper().writeValueAsString(service.selectReportComment(request));
		} catch (Exception e) {}
		return null;
	}
	
	/**
	 * 忽略相关举报
	 * @param request
	 * @return
	 */
	@RequestMapping("/ignoreComment")
	@ResponseBody
	public Map<String, Object> ignoreComment(HttpServletRequest request){
		return service.ignoreComment(request);
	}
	
	/**
	 * 删除相关评论
	 * @param request
	 * @return
	 */
	@RequestMapping("/deleteComment")
	@ResponseBody
	public Map<String, Object> deleteComment(HttpServletRequest request) {
		return service.deleteComment(request);
	}
}
